<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="keywords" content="广东国防教育学会">
    <meta name="description" content="广东国防教育学会">
    <title>广东国防教育学会</title>
    <link rel="shortcut icon" href="/Public/Admin/img/favicon.ico">
    <link href="/Public/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="/Public/Admin/bootstrap_validator-0.4.5/dist/css/bootstrapValidator.css"/>
    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/plugins/iCheck/all.css" rel="stylesheet">
    <style>
		/* *{
			color:#000;
		} */
		.btn{
		 	 padding: 5px 8px;
		 	 /* border-radius: 0px; */
			font-size:12px;
			margin-bottom:0px;
		}
		.table{
	    	width: 100%;
		}
		.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
			padding:0px 5px;
			/*text-align: center;*/
			vertical-align: middle!important;
		}
		.form-control{
			font-size: 12px;
		}
		#file-pretty button{
			padding: 7.5px 13px;
		}
		p{
	   		 margin: 0 0;
		}
		.pagination{
			margin:0px 0px;
		}
		.select_width{
			width:100px;
		}
		.select_no_border{
			border-right: none;
		}
	</style>
</head>
<link rel="stylesheet" href="/Public/Admin/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css"
      media="screen"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>答题数管理</h5>
                    <!--<div class="ibox-tools" style="margin-top: -6px;">
                        <button onclick="history.go(-1);" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</button>
                    </div>-->
                </div>
                <div class="ibox-content" >
                    <form id="defaultForm" action="/Admin/Answer/answerNum" method="post" enctype="multipart/form-data"
                          class="form-horizontal">
                        <input type="hidden" name="id" value="<?php echo ($data["id"]); ?>">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">每天答题次数</label>
                            <div class="col-sm-6">
                                <input id="every_day_num" type="text" name="every_day_num" class="form-control"
                                       value="<?php echo ($data["every_day_num"]); ?>">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group">
                            <label class="col-sm-2 control-label">满足抽奖的分数</label>
                            <div class="col-sm-6">
                                <input id="gopricesocre" type="text" name="gopricesocre" class="form-control"
                                       value="<?php echo ($data["gopricesocre"]); ?>">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">正式答题数</label>
                            <div class="col-sm-6">
                                <input onchange="getScoreNum(this);" id="formal_num" type="text" name="formal_num" class="form-control"
                                       value="<?php echo ($data["formal_num"]); ?>">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">每题得分</label>
                            <div class="col-sm-6">
                                <input id="score" type="text" name="score" class="form-control"
                                       value="<?php echo ($data["score"]); ?>">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                        <label class="col-sm-2 control-label">总分</label>
                        <div class="col-sm-6">
                            <input id="totalscore" readonly type="text" name="totalscore" class="form-control"
                                   value="<?php echo ($data["totalscore"]); ?>">
                        </div>
                         </div>
                        <div class="hr-line-dashed"></div>


                        <!--详情start-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">试题说明</label>
                            <div class="col-sm-6">
                                <textarea name="explain" class="col-sm-6 form-control" rows="5"><?php echo ($data["explain"]); ?></textarea>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit">保存</button>
                            <button class="btn btn-white" type="submit">取消</button>
                        </div>
                        </div>

                </form>
            </div>
        </div>
    </div>
</div>
</div>
</div>


<script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<!-- <script src="/Public/Admin/js/content.min.js?v=1.0.0"></script> -->
<script type="text/javascript" src="/Public/Admin/bootstrap_validator-0.4.5/dist/js/bootstrapValidator.js"></script>
<script src="/Public/Admin/plugins/layer/layer.js"></script>
<script src="/Public/Admin/plugins/iCheck/icheck.min.js"></script>

<script>
//设置checkbox按钮
$('.i-check').iCheck({
	checkboxClass : "icheckbox_square-green",
	radioClass : "iradio_square-green",
});
</script>

</body>
</html>



<script>
    $(document).ready(function () {
        $('#formal_num').blur(function () {
            var num = $('#formal_num').val();
            var score = $('#score').val();
            $("#totalscore").attr('value',total);
        });

        $('#score').blur(function () {
            var num = $('#formal_num').val();
            var score = $('#score').val();
            var total = num * score;
            if(total>100)
            {
                alert('总分不得大于100分！');
                return false;
            }
            $("#totalscore").attr('value',total);
        });
    })
</script>


<script>
    $(document).ready(function() {
        /**
         * 下面是进行插件初始化
         * 你只需传入相应的键值对
         * */
        $('#defaultForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {/*输入框不同状态，显示图片的样式*/
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {/*验证*/
                formal_num: {/*键名username和input name值对应*/
                    message: '答题数验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '答题数不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 100,
                            message: '答题数长度必须在1到200之间'
                        }/*最后一个没有逗号*/
                    }
                },
                score: {/*键名username和input name值对应*/
                    message: '每题得分验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '选每题得分不能为空'
                        },
                    }
                },
                explain: {/*键名username和input name值对应*/
                    message: '',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '试题说明不能为空'
                        },
                    }
                },
            }
        });
    });
</script>

</body>
</html>